home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MEMORY.SWG / 0043_Total Memory.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  989b  |  39 lines

  1. {
  2. > How would you go about displaying themount of total memory ram
  3. > installed in a computer.
  4. > i have tried Intr($15,regs);
  5. > with regs do
  6. > AH := $88;
  7. > Writeln(regs.(AX);
  8. > I read the above in Peter Nortons Programmers Bible  but i get some
  9. > number that I'm sure what to do which;
  10. > i was wondering if some one could help thanks
  11.  
  12.      Russ, you have to load AH with $88 before the Int 15 call, not
  13.      after.  However, HIMEM hooks this interrupt anyway and only shows
  14.      available extended memory, not installed memory.  Try the following
  15.      program instead:
  16. }
  17. program show_ram;
  18. const
  19.   int15: longint = $f000f859;
  20. var
  21.   baseram,extram: word;
  22. begin
  23.   asm
  24.     int   12h
  25.     mov   baseram,ax
  26.     mov   ah,88h
  27.     pushf
  28.     call  int15
  29.     mov   extram,ax
  30.   end;
  31.   writeln('Base RAM = ',baseram,' Kbytes');
  32.   writeln('Extended RAM = ',extram,' KBytes');
  33. end.
  34.  
  35. {
  36. This works on 286 cpu's and above since 8088/8086's don't have
  37. extended memory.
  38. }
  39.